package net.inteidee.persistenza;

import javax.persistence.EntityManager;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;


public class Main {
	
	public static void main(String[] args) {
		
		
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("Jaas");
		EntityManager em = emf.createEntityManager();
		
		MyLogging m = new MyLogging();
		m.setCreate_time(System.currentTimeMillis());
		m.setUpdate_time(System.currentTimeMillis());
		m.setCreated_by("Rino");
		m.setUpdated_by("Rino");
		m.setDeleted(true);
		
		 em.getTransaction().begin();
	     Utente u = new Utente ();
	     u.setEmail("rino");u.setCodiceFiscale("Cf");
	     u.setCognome("aaa");u.setNome("rino");
	     u.setPassword("aaa"); u.setStato(true);
	     u.setMyLogging(m);
	     em.persist(u);
	    		  
	    		  
	     em.getTransaction().commit();
	}

}
